var fs = require("fs");
var path = require("path");
const { Readable } = require("stream");
const { Writable } = require("stream");

var rFilePath = path.join(__dirname,"/from.txt");
var wFilePath = path.join(__dirname,"/to.txt");
var readable = fs.createReadStream(rFilePath);
var writable = fs.createWriteStream(wFilePath);
readable.on("data",function(chunk){
    console.log(chunk.toString("utf-8"));
    str1 = chunk.toString("utf-8");
    str2 = str1.toUpperCase();
    writable.write(str2);
    writable.end();

})
readable.on("end",function(){
    console.log(str2);
})

// readable.pipe(process.stdout);



